{extend name='main'}

{block name="button"}
<!--{if auth("add")}-->
<button data-open='{:url("pageEdit")}' data-title="添加轮播图" class='layui-btn layui-btn-sm layui-btn-primary'>添加轮播图</button>
<!--{/if}-->
{/block}

{block name="content"}
<div class="think-box-shadow">
  <div class="layui-tab-content">
    {include file='banner/search'}
    <table id="BaseData" data-url="{:sysuri()}" data-target-search="form.form-search"></table>
  </div>
  <table class="layui-table margin-top-10" lay-skin="line">
    {notempty name='list'}
    <thead>
    <tr>
      <th class='list-table-check-td think-checkbox'>
        <label><input data-auto-none data-check-target='.list-check-box' type='checkbox'></label>
      </th>
      <th width="" class='text-center nowrap'>类型</th>
      <th width="" class='text-center nowrap'>标题</th>
      <th width="" class='text-center nowrap'>图片</th>
      <th width="" class='text-center nowrap'>内容</th>
      <th width="" class='text-center nowrap'>状态</th>
      <th width="" class='text-center nowrap'>操作</th>
    </tr>
    </thead>
    {/notempty}
    <tbody>
    {foreach $list as $key=>$vo}
    <tr>
      <td class='list-table-check-td think-checkbox'>
        <label><input class="list-check-box" type='checkbox' value='{$vo.id}'></label>
      </td>
      <td class="text-center nowrap">{$vo.type|getBannerType}</td>
      <td class="text-center nowrap">{$vo.title|default=""}</td>
      <td class="text-center nowrap">
        <img width="120" height="100" src='{$vo.image|default=""}' alt=""/>
      </td>
      <td class="text-center nowrap">{$vo.content|getSubstr="100"}</td>
      <td class="text-center nowrap">
        {eq name='vo.is_deleted' value='0'}<span class="layui-badge layui-bg-green">正常</span>{else}<span class="layui-badge">已删除</span>{/eq}
      </td>
      <td class="text-center nowrap">

        <!--{if auth('pageEdit')}-->
        <a class="layui-btn layui-btn-sm" data-open="{:url('pageEdit')}?id={$vo.id}" data-title="编辑" data-dbclick data-value="id#{$vo.id}" data-csrf="{:systoken('pageEdit')}">编辑</a>
        <!--{elseif auth('del') and $vo.is_deleted eq 0}-->
        <a class="layui-btn layui-btn-sm" data-action="{:url('del')}" data-value="id#{$vo.id}" data-csrf="{:systoken('del')}">删除</a>
        <!--{/if}-->

        <!--{if auth("remove")}-->
        <a class="layui-btn layui-btn-sm layui-btn-danger" data-action="{:url('remove')}" data-value="id#{$vo.id}" data-csrf="{:systoken('remove')}" data-confirm="确定要删除该项吗？">删 除</a>
        <!--{/if}-->

      </td>
    </tr>
    {/foreach}
    </tbody>
  </table>

  {empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}
</div>

{/block}